package com.hongdee.crm.coupon.mapper;

import com.hongdee.crm.coupon.pojo.TCrmCarCouponPojo;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * Created by Liu XiaoLong
 * Date: 2017/11/21.
 * Remark:
 */
@Mapper
public interface ITCrmCarCouponMapper {

    @SelectProvider(type = TCrmCarCouponQuery.class,method = "list")
    @Results({
            @Result(id = true, column = "id", property = "id"),

            @Result(column = "vin", property = "vin")/*,
            @Result(column = "plate_num", property = "plateNum"),
            @Result(column = "owner", property = "owner"),
            @Result(column = "owner_phone", property = "ownerPhone"),
            @Result(column = "type", property = "type"),
            @Result(column = "content", property = "content"),
            @Result(column = "node", property = "node"),
            @Result(column = "submit_time", property = "submitTime"),
            @Result(column = "degree", property = "degree"),
            @Result(column = "status", property = "status")*/

    })
    List<TCrmCarCouponPojo> list(@Param("node") String node, @Param("data") Map data);


    /**
     * 更新状态
     */
    @Update("update t_crm_car_coupon set status = '3' where youxiaoqi < #{nowTime} and status = '1' ")
    void UpdateStatus( @Param("nowTime") String nowTime);
}
